
#ifndef _GRP_H_
#define	_GRP_H_

#include <sys/types.h>

#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
#define	_PATH_GROUP		"/etc/group"
#endif

struct group {
	char	*gr_name;		/* group name */
	char	*gr_passwd;		/* group password */
	gid_t	gr_gid;			/* group id */
	char	**gr_mem;		/* group members */
};


#ifdef __cplusplus
extern "C" {
#endif

struct group	*getgrgid (gid_t);
struct group	*getgrnam (const char *);
int		 getgrnam_r (const char *, struct group *,
			char *, size_t, struct group **);
int		 getgrgid_r (gid_t, struct group *,
			char *, size_t, struct group **);
#ifndef _POSIX_SOURCE
struct group	*getgrent (void);
void		 setgrent (void);
void		 endgrent (void);
void		 setgrfile (const char *);
#ifndef _XOPEN_SOURCE
char		*group_from_gid (gid_t, int);
int		 setgroupent (int);
#endif /* !_XOPEN_SOURCE */
#endif /* !_POSIX_SOURCE */

#ifdef __cplusplus
}
#endif

#endif /* !_GRP_H_ */
